<template>
<div class="container__">
    <div class="flex" v-for="(item, index) in tixianlist" :key="index">
        <div class="imgs"><img src="/static/images/cion.png" alt=""></div>
        <van-cell v-if="tixianlist" use-label-slot >
            <view class="title" slot="title">提现到微信</view>
            <view class="lable" slot="label">{{item.created_at}}</view>
            <view class="value">提现{{item.money}}，到账{{item.actual_money}}</view>
        </van-cell>
    </div>
</div>
</template>

<script>
import {cashjilu} from '@/api/my'
export default {
    data() {
        return {
            tixianlist: [],
            page:1,
            load:false
        }
    },
    methods: {
        getlist(){
            cashjilu({page:this.page}).then(res=>{
                if(res.code==200){
                    this.page==1?this.tixianlist=res.data.data:this.tixianlist=this.tixianlist.concat(res.data.data)
                    let last_page=res.data.last_page;
                    last_page>this.page?this.load=true:this.load=false
                }else if(res.code==201){

                }
            })
        }
    },
    onLoad() {
         this.getlist()
    },
     onReachBottom(){
        if(this.load){
            this.page++
            this.getList()
        }
    },
    onUnload(){
        Object.assign(this.$data, this.$options.data())
    },
}
</script>

<style lang="scss">
.container__ {
    background-color: #fff;
    min-height: 100vh;
    font-size: 16px;

    .flex {
        display: flex;
        justify-content: space-between;
        align-items: center;

        .imgs {
            width: 55px;
            display: flex;
            justify-content: center;
            img{
                width: 30px;
                height: 30px;
                border-radius: 50%;
                border: 1px solid #ddd;
            }
        }
    }

    .van-cell {
        align-items: center;
        width: 321px;
        // padding: 0 15px 0 0;
        height: 60px;
        box-sizing: border-box;
    }

    .title {
        font-size: 14px;
        color: #000
    }

    .lable {
        font-size: 12px;
    }

    .value {
        font-size: 14px;
        color: #000
    }

}
</style>
